<?php
/* Generieke definitie file */
include_once '../includes/defs/constants.php';
include_once '../includes/classes/datum.php';
include_once '../includes/classes/rooster.php';

require ('../includes/connect.php');




?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/xhtml" lang="nl">
<head>
<title>M in Events - Eigen rooster</title>

<LINK rel="stylesheet" href="../includes/mystyle.css" type="text/css" /> 

<link rel="icon" href="../images/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="../images/favicon.ico" type="image/x-icon" />
<link rel="favicon" href="../images/favicon.ico" type="image/x-icon" />

</head>

<body>
<div id="wrapper">
	<div id="circle">
		<div id="header">
			<div id="header-left">
				<div id="koptekst">
					Rooster
				</div>
			</div>
			<div id="header-right">
				<a href="optie.php"><img src="../images/instellingen.png" border="0"></a>
				<img src="../images/faq.png">
				<img src="../images/uitloggen.png">
				<div id="naam">
					<p style="font-size: 14px;">Ingelogd als:</br></p>
					<p style="font-size: 26px;"><b>Tim van den Elsen</b></br></p>
				</div>
			</div>
		</div>
		<div id="content-wrapper">
			<div id="menu-left">
				<div id="menu-left-content">
					<a href="http://127.0.0.1/minevents/" style="text-decoration: none" >
					<img src="../images/home_button.png"> </a>
				</div>
			</div>
			<div id="menu-right1">
				<div id="menu-rooster">
					<img src="../images/menu_button.png"/>
				</div>
				<div id="menu-afdeling">
					<img src="../images/menu_button.png"/>
				</div>
				
			</div>
			<div id="menu-right2">
				<div id="menu-rooster-text">
					<a href="/minevents/rooster" style="text-decoration: none" >
					<b>Mijn rooster</b> </a>
				</div>
				
				<div id="menu-wijzigen-text">
				<a href="overzicht.php" style="text-decoration: none" >
                                    <b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Overzicht</b> </a>
				</div>
			</div>
			<div id="content">
				<div id="content-koptekst">
					<b>Mijn rooster</b>
				</div>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                           
                           
				<div id="content01">
					
				</div>
				<div id="content02">
				
					                <?php
                                                        
                                                                                     
               
        $test = new Rooster();
        
        $test->setStatusId(1);
        $test->setRoosterstatus('nieuw');
        $test->setTekst('teksten');        
        $test->setAanmaakpersoon('Tim');
        
        if (!$test->saveRooster()){
            $errs = $test->getErrorArray();
            foreach($errs as $idx => $error){
                echo "$error<br />\n";
            }
        }  
        $test->object();


        
  
        $test1 = new Rooster(1000);
        
        $test1->setStatusId(2);
        $test1->setRoosterstatus('oud');
        $test1->setTekst('tekstenes');        
        $test1->setAanmaakpersoon('trinco');
        
        if (!$test1->wijzigRooster()){
            $errs = $test1->getErrorArray();
            foreach($errs as $idx => $error){
                echo "$error<br />\n";
            }
        }          
     
        
     
        $test2 = new Rooster(10);
        
        if (!$test2->verwijderRooster()){
            $errs = $test2->getErrorArray();
            foreach($errs as $idx => $error){
                echo "$error<br />\n";
            }
        }          
   
        
        echo "Test 2 DbRooster: Haalt waarden uit de database a.d.h.v. ID.<br />";
        $test3 = new DbRooster(1);
        echo "Rooster ID: "        . $test3->getRoosterId()       . "<BR>";
        echo "Roosterstatus ID: ". $test3->getRoosterStatusId() . "<BR>";
        echo "Roosterstatus: "   . $test3->getRoosterStatus()   . "<BR>";
        echo "Tekst: "           . $test3->getTekst()           . "<BR>";
        echo "Creatietijd: "     . $test3->getCreatietijd()     . "<BR>";
        echo "Aanmaakpersoon: "    . $test3->getAanmaakpersoon()  . "<BR>";

        if($test3->getErrorNr() > 0 ){
        $error=$test3->getErrorArray();
        }
        

?>

                                  
				</div>
			</div>
		</div>
		<div id="footer">
			Realisatie: Stichting Innovision Solutions
		</div>
	</div>
</div>
</body>
</html>